package TrabalhoEda;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Line2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;

@SuppressWarnings("serial")
public class ApresentarImage extends Component
{
	private ArrayList<Ponto> listaNosFechados;		
	
	private BufferedImage bufferedImage;
	
	public ApresentarImage(BufferedImage bufferedImage, ArrayList<Ponto> listaNosFechados) 
	{
		this.bufferedImage = bufferedImage;
		
		this.listaNosFechados = listaNosFechados;
	}
	
	public void paint(Graphics g)
	{
		
		g.drawImage(bufferedImage, 0, 0, 512, 512, null);
		
		
		
		for (Ponto p : this.listaNosFechados)
        {
                Line2D line = new Line2D.Double(p.x, p.y, p.x, p.y);
                Graphics2D linha = (Graphics2D) g;
                linha.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                linha.setColor(Color.GREEN);
                linha.draw(line);
        }
	
	}
	
}
